<%= javascript_include_tag "prototype", "effects", "controls", "window", "application","dragdrop"%>
<%= stylesheet_link_tag "sbstyle", :media => "all" %>
<title>图片上传</title>
<body onunload="$('load').src='/images/progress.gif'">
<fieldset
	style="width:350;border:4px double;border-color:#ccc;margin-top:60px;padding-top:60px;"
	align="center"><legend align="center"> <% if flash[:notice] -%> <%= flash[:notice] %>
<%else -%> 图片上传 <% end -%></legend> <%= form_tag({:controller=>"info",:action =>'save_picture',:id=>@id,:obj_id=>@obj_id,:cat_id=>@cat_id}, :multipart=> true) %>
<%= file_field "picture", "picture",{:class=>"btn_mouseout",
	:onmouseover=>"this.className='btn_mouseover'",
	:onmouseout=>"this.className='btn_mouseout'",
	:onmousedown=>"this.className='btn_mousedown'",
	:onmouseup=>"this.className='btn_mouseup'"}%>
<div style="margin:5px;padding:5px;" align="center"><div style="width:62px;height:62px;"><div class="out"><div class="in"><img id="load"
	src=<%=url_for(:controller=>"index",:action=>"post_picture",:id=>@id)%> /></div></div></div></div>
<span style="width:300;">
<div class="left_info_sidebar"><%= submit_tag "上传图片",:class=>"btn_mouseout",
			:onmouseover=>"this.className='btn_mouseover'",
			:onmouseout=>"this.className='btn_mouseout'",
			:onmousedown=>"this.className='btn_mousedown'",
			:onmouseup=>"this.className='btn_mouseup'", 
			:onClick=>"$('load').src='/images/upload.gif'"%> <%= end_form_tag %></div>
<div class="right_info_sidebar"><%= form_tag%><%= submit_tag " 关  闭 ",:class=>"btn_mouseout",
			:onmouseover=>"this.className='btn_mouseover'",
			:onmouseout=>"this.className='btn_mouseout'",
			:onmousedown=>"this.className='btn_mousedown'",
			:onmouseup=>"this.className='btn_mouseup'", 
			:onClick=>"window.opener.document.getElementById('"+update_image_tag(@cat_id,@obj_id)+"').src='"+url_for(:controller=>'index',:action=>'post_picture',:id=>@id)+"';window.opener.document.getElementById('"+update_image_link(@cat_id,@obj_id)+"').href='"+url_for(:controller=>'info', :action => 'upload_picture',:id=>@id,:obj_id=>@obj_id,:cat_id=>@cat_id)+"';self.close();"%>
<%= end_form_tag %></div>
</span></fieldset>
<%= draggable_element("load", :revert => true)%>
</body>
